package com.ruoyi.peizhen.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.peizhen.mapper.PzHospitalHospitalMapper;
import com.ruoyi.peizhen.domain.PzHospitalHospital;
import com.ruoyi.peizhen.service.IPzHospitalHospitalService;
import com.ruoyi.common.core.text.Convert;

/**
 * 医院Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-13
 */
@Service
public class PzHospitalHospitalServiceImpl implements IPzHospitalHospitalService 
{
    @Autowired
    private PzHospitalHospitalMapper pzHospitalHospitalMapper;

    /**
     * 查询医院
     * 
     * @param id 医院主键
     * @return 医院
     */
    @Override
    public PzHospitalHospital selectPzHospitalHospitalById(Long id)
    {
        return pzHospitalHospitalMapper.selectPzHospitalHospitalById(id);
    }

    /**
     * 查询医院列表
     * 
     * @param pzHospitalHospital 医院
     * @return 医院
     */
    @Override
    public List<PzHospitalHospital> selectPzHospitalHospitalList(PzHospitalHospital pzHospitalHospital)
    {
        return pzHospitalHospitalMapper.selectPzHospitalHospitalList(pzHospitalHospital);
    }

    /**
     * 新增医院
     * 
     * @param pzHospitalHospital 医院
     * @return 结果
     */
    @Override
    public int insertPzHospitalHospital(PzHospitalHospital pzHospitalHospital)
    {
        pzHospitalHospital.setCreateTime(DateUtils.getNowDate());
        return pzHospitalHospitalMapper.insertPzHospitalHospital(pzHospitalHospital);
    }

    /**
     * 修改医院
     * 
     * @param pzHospitalHospital 医院
     * @return 结果
     */
    @Override
    public int updatePzHospitalHospital(PzHospitalHospital pzHospitalHospital)
    {
        pzHospitalHospital.setUpdateTime(DateUtils.getNowDate());
        return pzHospitalHospitalMapper.updatePzHospitalHospital(pzHospitalHospital);
    }

    /**
     * 批量删除医院
     * 
     * @param ids 需要删除的医院主键
     * @return 结果
     */
    @Override
    public int deletePzHospitalHospitalByIds(String ids)
    {
        return pzHospitalHospitalMapper.deletePzHospitalHospitalByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除医院信息
     * 
     * @param id 医院主键
     * @return 结果
     */
    @Override
    public int deletePzHospitalHospitalById(Long id)
    {
        return pzHospitalHospitalMapper.deletePzHospitalHospitalById(id);
    }
}
